<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Add tile without load event</title>
        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjU0EJWnWPMv7oQ-jjS7dYxQGj0PqsCtxKvarsoS-iqLdqZSKfxRdmoPmGl7Y9335WLC36wIGYa6o5Q" type="text/javascript">
        </script>
        <script type="text/javascript">
            document.write('<script type="text/javascript" src="../src/arcgislink' + (document.location.search.indexOf('packed') > -1 ? '_packed' : '') + '.js"><' + '/script>');
        </script>
        <script type="text/javascript">
            
            function init() {
              var tileInfo = {
                "rows": 512,
                "cols": 512,
                "dpi": 96,
                "origin": {
                  "x": -180,
                  "y": 90
                },
                "spatialReference": {
                  "wkid": 4326
                },
                "lods": [
                  {"level" : 0, "resolution" : 0.351562499999999, "scale" : 147748799.285417}, 
                  {"level" : 1, "resolution" : 0.17578125, "scale" : 73874399.6427087}, 
                  {"level" : 2, "resolution" : 0.0878906250000001, "scale" : 36937199.8213544}, 
                  {"level" : 3, "resolution" : 0.0439453125, "scale" : 18468599.9106772}, 
                  {"level" : 4, "resolution" : 0.02197265625, "scale" : 9234299.95533859}, 
                  {"level" : 5, "resolution" : 0.010986328125, "scale" : 4617149.97766929}, 
                  {"level" : 6, "resolution" : 0.0054931640625, "scale" : 2308574.98883465}, 
                  {"level" : 7, "resolution" : 0.00274658203124999, "scale" : 1154287.49441732}, 
                  {"level" : 8, "resolution" : 0.001373291015625, "scale" : 577143.747208662}, 
                  {"level" : 9, "resolution" : 0.0006866455078125, "scale" : 288571.873604331}, 
                  {"level" : 10, "resolution" : 0.000343322753906249, "scale" : 144285.936802165}, 
                  {"level" : 11, "resolution" : 0.000171661376953125, "scale" : 72142.9684010827}, 
                  {"level" : 12, "resolution" : 8.58306884765626E-05, "scale" : 36071.4842005414}, 
                  {"level" : 13, "resolution" : 4.29153442382813E-05, "scale" : 18035.7421002707}, 
                  {"level" : 14, "resolution" : 2.14576721191406E-05, "scale" : 9017.87105013534}, 
                  {"level" : 15, "resolution" : 1.07288360595703E-05, "scale" : 4508.93552506767}
                  ]
              };
              var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer';
              var agsType = new ArcGISMapType(url,{projection: new ArcGISProjection(tileInfo)});
              // note no load event listener.
              var map = new GMap2(document.getElementById("map"), { mapTypes: [agsType]});
              map.setCenter(new GLatLng(45.5, -122.7), 15);
              map.addControl(new GMapTypeControl());
              map.addControl(new GLargeMapControl());
              map.addControl(new GScaleControl());
              map.enableDoubleClickZoom();
              map.enableContinuousZoom();
              map.enableScrollWheelZoom();
            }
        </script>
    </head>
    <body onload="init()">
        <a href='../docs/examples.html'>More examples</a>
        | Use <a href='?packed'>Packed </a>
        | <a href='?'> Unpacked</a>
        Version of the script.
        <br/>
        <div>
            Add tiles with pre-defined projection, without listerning to 'load' event.
        </div>
        <div id="map" style="width:700px; height:400px; border:1px solid #000;">
        </div>
    </body>
</html>
